package com.jz.netthings.engine.service;

import com.jz.netthings.appengine.baseData.AllotData;
import com.jz.netthings.application.bodyCheck.bean.BodyCheck;
import com.jz.netthings.application.providerCreate.bean.ProviderZw;
import com.jz.netthings.engine.bean.*;
import com.jz.netthings.exception.AdscmSystemException;
import com.jz.netthings.netty.protocol.bean.*;

import java.util.List;

/**
 * 客户端请求的接口
 */
public interface ClientService {


    /**
     * 客户端登录
     * @param packet
     * @return
     */
    LoginResponsePacket clientUserLogin(LoginRequestPacket packet);

    /**
     * 人脸认证
     * @param packet
     * @return
     */
    FaceValidateResponsePacket clientFaceValidate(FaceValidateRequestPacket packet);

    /**
     * 登记查询根据卡号身份证查询是否满足献浆条件
     * @param idCard
     * @return
     * @throws AdscmSystemException
     */
    BloodUser providerReqRegisterMsg(String idCard) throws AdscmSystemException;

    /**
     * 上传信息进行建档
     * @param bloodUser
     * @return
     */
    BloodUser providerCreate(BloodUser bloodUser) throws AdscmSystemException;

    /**
     * 根据code进行登记
     * @param registerReqData
     * @return
     * @throws AdscmSystemException
     */
    RegisterData providerRegister(RegisterReqData registerReqData)throws AdscmSystemException;

    /**
     * 修改体检信息
     * @param bloodUser
     * @return
     * @throws AdscmSystemException
     */
    BloodUser bodycheckMsg(BloodUser bloodUser) throws AdscmSystemException;

    /**
     * 一体机做一些操作的指令：呼叫体检、体检结束、呼叫化检...
     * @param code
     * @param cmd
     */
    void doProcessProvider(String code, String cmd )throws AdscmSystemException ;

    /**
     * 上传建档照片
     * @param bloodUser
     * @return
     */
    boolean saveProviderCreatePhoto(BloodUser bloodUser)throws AdscmSystemException;
    /**
     * 上传指纹信息
     * @param fingerprint
     * @return
     */
    boolean saveProviderCreateZw(List<Fingerprint> fingerprint,String cardId)throws AdscmSystemException;

    /**
     * 生成小样记录
     * @param bloodUser
     * @throws AdscmSystemException
     */
    String samlpeInsert(BloodUser bloodUser) throws  AdscmSystemException;

    /**
     * 手动分配浆员到采浆机
     * @param code
     * @param nurseid
     * @param mcode
     * @return
     * @throws AdscmSystemException
     */
    AllotData manualAllotByProvider(String code, String nurseid, String mcode) throws AdscmSystemException;

    List<Fingerprint> getProviderCreateZw(String cardId) throws AdscmSystemException;

    /**
     * 自动分配浆员到采浆机
     * @param code
     * @param nurseid
     * @return
     */
    AllotData autoAllotByProvider(String code, String nurseid)throws AdscmSystemException;

    /**
     * 修改热合表
     * @param bloodUser
     * @return
     * @throws AdscmSystemException
     */
    ProviderHeat updateHeat(BloodUser bloodUser) throws AdscmSystemException;

    BloodUser queryProviderInfo(String idCard)throws AdscmSystemException;

    CostInfo providerCost(CostInfo costInfo)throws AdscmSystemException;

    /**
     * 取消浆员分配的设备
     * @param code
     * @throws AdscmSystemException
     */
    void freeMachineByProvider(String code)throws AdscmSystemException;
    /**
     * 重置设备为空闲状态
     * @param mcode
     * @throws AdscmSystemException
     */
    void doFreeMachine(String mcode)throws AdscmSystemException;


    String[] getImgsPath(String idCard, byte[] face);
}
